function autoYSPlogin() {
    var usernameTPL = yspUser.getUserElementXPath(document.location.href);
    var passwordTPL = yspUser.getPassElementXPath(document.location.href);
    var certTPL = yspUser.getCertElementXPath(document.location.href);
    var buttonTPL =  yspUser.getSubmitElementXPath(document.location.href);
    
    var u_elem = document.evaluate(usernameTPL, document).iterateNext();
    var p_elem = document.evaluate(passwordTPL, document).iterateNext();
    var c_elem = document.evaluate(certTPL, document).iterateNext();
    var b_elem = document.evaluate(buttonTPL, document).iterateNext();

    if (!u_elem || !p_elem || !b_elem || c_elem) {
        return;
    }

    var u_value = yspUser.getUsername(document.location.href);
    if (u_value) {
        u_elem.value = u_value;
        var p_value = yspUser.getPassword(document.location.href);
        if (p_value) {
            p_elem.value = p_value;
            if (b_elem) {
                b_elem.click();
            }
        } else {
            document.body.hidden = false;
        }
    } else {
        document.body.hidden = false;
    }
}